#ifndef INETADDRESS_H
#define INETADDRESS_H

#include <netinet/in.h>

#include "StringPiece.h"



class InetAddress {
public:
    InetAddress() = default;
    InetAddress(uint32_t ip, uint16_t port);
    InetAddress(uint16_t port);
    InetAddress(StringPiece ip, uint16_t port);

    sockaddr* getSockAddr();

    int size() {
        return sizeof (addr_);
    }

    string toString();

private:
    sockaddr_in addr_;
};

#endif